package au.com.bluelink.scjp.chap4;

public class OperatorTest {

	public static void main(String[] args) {
		AssignmentOps.test();

	}

}

class Cat {
}

class Dog {
	public static void test() {
		Dog d = new Dog();
		// can't use instanceof operator on non-related object references
		//System.out.println(d instanceof Cat);
		
		// we can however test null reference vars, even using the keyword null directly
		System.out.println(null instanceof Cat);
	}
}

class AssignmentOps {
	public static void test() {
		int sizeOfYard = 10;
		int numOfPets = 3;
		String status = (numOfPets < 4) ? "Pet count OK" : (sizeOfYard > 8) ? "Pet limit on the edge" : "too many pets";
		System.out.println("Pet status is " + status);
	}
}
